package cn.com.guage.dtm.huawei;

import java.util.Scanner;

public class HexToDecimal {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String hexStr = scanner.nextLine();
            // 去掉 0x 前缀
            String realHex = hexStr.substring(2);
            try {
                int decimal = Integer.parseInt(realHex, 16);
                System.out.println(decimal);
            } catch (NumberFormatException e) {
                System.out.println("输入的不是有效的十六进制数");
            }
        }
        scanner.close();
    }
}    